namespace ShareMarking.Systems.Entity {
    using System;
    using MySoft.Data;


    /// <summary>
    /// 表名：sys_manager_role 主键列：id
    /// </summary>
    [SerializableAttribute()]
    public partial class sys_manager_role : Entity
    {

        protected Int32 _id;

        protected String _role_name;

        protected Int32 _role_type;

        protected Int32 _is_sys;

        public Int32 id
        {
            get
            {
                return this._id;
            }
            set
            {
                this.OnPropertyValueChange(_.id, _id, value);
                this._id = value;
            }
        }

        public String role_name
        {
            get
            {
                return this._role_name;
            }
            set
            {
                this.OnPropertyValueChange(_.role_name, _role_name, value);
                this._role_name = value;
            }
        }

        public Int32 role_type
        {
            get
            {
                return this._role_type;
            }
            set
            {
                this.OnPropertyValueChange(_.role_type, _role_type, value);
                this._role_type = value;
            }
        }

        public Int32 is_sys
        {
            get
            {
                return this._is_sys;
            }
            set
            {
                this.OnPropertyValueChange(_.is_sys, _is_sys, value);
                this._is_sys = value;
            }
        }

        /// <summary>
        /// 获取实体对应的表名
        /// </summary>
        protected override Table GetTable()
        {
            return new Table<sys_manager_role>("sys_manager_role");
        }

        /// <summary>
        /// 获取实体中的标识列
        /// </summary>
        protected override Field GetIdentityField()
        {
            return _.id;
        }

        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        protected override Field[] GetPrimaryKeyFields()
        {
            return new Field[] {
                        _.id};
        }

        /// <summary>
        /// 获取列信息
        /// </summary>
        protected override Field[] GetFields()
        {
            return new Field[] {
                        _.id,
                        _.role_name,
                        _.role_type,
                        _.is_sys};
        }

        /// <summary>
        /// 获取列数据
        /// </summary>
        protected override object[] GetValues()
        {
            return new object[] {
                        this._id,
                        this._role_name,
                        this._role_type,
                        this._is_sys};
        }

        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        protected override void SetValues(IRowReader reader)
        {
            if ((false == reader.IsDBNull(_.id)))
            {
                this._id = reader.GetInt32(_.id);
            }
            if ((false == reader.IsDBNull(_.role_name)))
            {
                this._role_name = reader.GetString(_.role_name);
            }
            if ((false == reader.IsDBNull(_.role_type)))
            {
                this._role_type = reader.GetInt32(_.role_type);
            }
            if ((false == reader.IsDBNull(_.is_sys)))
            {
                this._is_sys = reader.GetInt32(_.is_sys);
            }
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if ((obj == null))
            {
                return false;
            }
            if ((false == typeof(sys_manager_role).IsAssignableFrom(obj.GetType())))
            {
                return false;
            }
            if ((((object)(this)) == ((object)(obj))))
            {
                return true;
            }
            return false;
        }

        public class _
        {

            /// <summary>
            /// 表示选择所有列，与*等同
            /// </summary>
            public static AllField All = new AllField<sys_manager_role>();

            /// <summary>
            /// 字段名：id - 数据类型：Int32
            /// </summary>
            public static Field id = new Field<sys_manager_role>("id");

            /// <summary>
            /// 字段名：role_name - 数据类型：String
            /// </summary>
            public static Field role_name = new Field<sys_manager_role>("role_name");

            /// <summary>
            /// 字段名：role_type - 数据类型：Int32
            /// </summary>
            public static Field role_type = new Field<sys_manager_role>("role_type");

            /// <summary>
            /// 字段名：is_sys - 数据类型：Int32
            /// </summary>
            public static Field is_sys = new Field<sys_manager_role>("is_sys");
        }
    }
}
    